﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ZFY.AspNetCore
{
    public class ZFYReponse<T>
    {
        /// <summary>
        /// 操作是否成功
        /// </summary>
        public bool Success { get; set; }
        /// <summary>
        /// 返回信息
        /// </summary>
        public string Msg { get; set; }
        /// <summary>
        /// 返回数据
        /// </summary>
        public T Data { get; set; }
        public bool Redirect { get; set; } = false;
    }
    public static class Untils
    {
        public static ZFYReponse<T> GetReponse<T>(this T data,bool redirect = false)
        {
            return new ZFYReponse<T>
            {
                Data = data,
                Success = true,
                Redirect = redirect
            };
        }
    }
}
